/* 
 * Spiral Matrix II
 */

#include "../func.h"

vector<vector<int>> generateMatrix(int n) {
    vector<vector<int>> matrix(n, vector<int>(n));
    int begin = 0, end = n - 1;
    int num = 1;

    while (begin < end) {
        for (int j = begin; j < end; ++j)
            matrix[begin][j] = num++;
    }
}